package com.zhongxi.guoyuan.adapter.rewardCoin;

import android.support.v4.app.FragmentManager;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentStatePagerAdapter;

import com.zhongxi.guoyuan.view.rewardCoin.FragmentFactory;


/**
 * Created by Administrator on 2017/9/30.
 */

public class RewardHMAdapter extends FragmentStatePagerAdapter {

    private String trim;
    private String id;

    public RewardHMAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public CharSequence getPageTitle(int position) {
        String title = "全部";
        switch (position) {
            case 0:
                title = "   全 部   ";
                break;
            case 1:
                title = "红豆+美豆";
                break;
            case 2:
                title = "2 倍美豆";
                break;
            case 3:
                title = "1 倍美豆";
                break;
        }
        return title;
    }

    @Override
    public Fragment getItem(int position) {
        return FragmentFactory.create(position, id, trim);
    }

    @Override
    public int getItemPosition(Object object) {
        return POSITION_NONE;
    }

    @Override
    public int getCount() {
        return 4;
    }

    public void setPrimary(String id, String trim) {
        this.id = id;
        this.trim = trim;
    }
}
